var ns,  app;
app = new Vue({
    el: '#app',
    data: {
        ID:0,
        form:{},
        otherUserList:[],
        registerImgList:[]
    },
    methods: {
        getData:function(){
            var that=this;
            var options = {};
            options.ID = that.ID;
            options.action = "getregisterplantasks";
            ns.post(options, function (succeed, data, err) {
                if (succeed) {
                    that.form = data.newModel;
                    that.otherUserList=data.otherUserList;
                    that.registerImgList=data.registerImgList;
                } else {
                    api.toast({
                        msg: err,
                        duration: 2000,
                        location: 'bottom'
                    });
                }
            })
        

        },
        tel_phone: function(item) {
            if(!item.PhoneNumber || item.PhoneNumber.length===0){
                api.toast({
                    msg: "该用户还没有添加电话号码",
                    duration: 2000,
                    location: 'bottom'
                });
            }
            else{
                api.call({
                    type: 'tel_prompt',
                    number: item.PhoneNumber
                });
            };
        },
        img_browser: function(item) {
            var that = this;
            var imgurls = [];
            imgurls.push(item.SysFinalFilePath);
            imageBrowser.openImages({
                imageUrls: imgurls,
                showList: false,
                activeIndex: 0
            });
        },

    }
});
apiready = function() {
    api.parseTapmode();
    ns = window.Foresight.Util;
    imageBrowser = api.require('imageBrowser');
    app.ID = api.pageParam.ID || 0;
    app.getData();
};
